﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example07.aspx.cs" Inherits="Chapter26.Example07" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 26-7 使用文档就绪状态来推迟脚本的执行</title>
    <meta name="author" content="Adam Freeman" />
    <meta name="description" content="A simple example" />
    <script>
        document.onreadystatechange = function () {
            if (document.readyState == "interactive") {
                document.getElementById("pressme").onclick = function () {
                    document.getElementById("results").innerHTML = "Button Pressed";
                }
            }
        }
    </script>
</head>
<body>
    <button id="pressme">Press Me</button>
    <pre id="results"></pre>
</body>
</html>
